package cn.online.dao;

import java.util.List;

import cn.online.model.Student;

public class StudentDao extends GenericDao<Student,Integer> {

	public Student get(String username,String password){
		List studentL=getHibernateTemplate().find("from Student as s where s.sname=? and s.spassword=?",new Object[]{username,password});
		if(studentL.size()!=0)
			return (Student)studentL.get(0);
		return null;
	}
	
	public Student get(String username){
		List studentL=getHibernateTemplate().find("from Student as s where s.sname=? ",new Object[]{username});
		if(studentL.size()!=0)
			return (Student)studentL.get(0);
		return null;
	}
}
